﻿using System.Windows.Forms;
using System;
using System.Threading;
using System.Net.Sockets;
using System.Net;
using System.IO;
using System.Text;
using System.Collections.Generic;


namespace FileServer
{
    public partial class Server : Form
    {
        private ServerAPI serverAPI;

        public Server()
        {
            InitializeComponent();
            
            Dictionary<string ,string> options = new Dictionary<string,string>();
            options.Add("addressofserver","127.0.0.1");
            options.Add("Downloaddir","D:\\got\\");
            serverAPI = new ServerAPI(options);
    
        }

        private void btn_Start_Click(object sender, EventArgs e)
        {
            btn_Start.Enabled = false;
            btn_Stop.Enabled = true;
            serverAPI.start();

        }




        private void btn_Stop_Click(object sender, EventArgs e)
        {
            btn_Start.Enabled = true;
            btn_Stop.Enabled = false;
            serverAPI.stop();
        }
    }
}